package com.topnav.mc.admin.dao.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.topnav.mc.admin.entity.GbCodeCity;
import com.topnav.mc.admin.entity.bean.GbCodeCityBean;
import com.topnav.mc.base.mc.McMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface GbCodeCityMapper extends McMapper<GbCodeCity, GbCodeCityBean, GbCodeCity> {
    String commSql = " SELECT c.*,c.id AS value, CONCAT(c.position,'(',c.id,')') AS label " +
            " FROM mc_code_city c " +
            " ${ew.customSqlSegment}";

    @Select(commSql)
    GbCodeCityBean selectInfoOne(@Param(Constants.WRAPPER) Wrapper queryWrapper);

    @Select(commSql)
    List<GbCodeCityBean> selectInfoList(@Param(Constants.WRAPPER) Wrapper queryWrapper);

    @Select(commSql)
    Page<GbCodeCityBean> selectInfoPage(Page<GbCodeCity> page, @Param(Constants.WRAPPER) Wrapper queryWrapper);
}
